home *** CD-ROM | disk | FTP | other *** search
- /*
- File: PCCardClient.h
-
- Contains: Definitions and constants for the PC Card Sample Client
-
- Written by: Dave Falkenburg with lots of helpful code from:
- Phillip Nguyen, Greg Brewer, timothy warden,
- James Blair, and Richard W. Mincher.
-
- Copyright © 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <0> 11/28/95 DRF first code.
- */
-
- #ifndef _APPLE_PCCARDCLIENT_
- #define _APPLE_PCCARDCLIENT_
-
- // PCCardClient.h
-
- #ifndef __CARDSERVICES__
- #include <CardServices.h>
- #endif
-
- #ifndef __CARDSERVICES__
- #include <Icons.h>
- #endif
-
-
- #ifndef DEBUG
- #define DEBUG 1
- #endif
-
- #if DEBUG
- #define IfDebugStr(x) DebugStr(x)
- #else
- #define IfDebugStr(x)
- #endif
-
-
- // Resource IDs used by the PC Card Driver “framework”
-
- enum
- {
- kCardIconID = 128,
- kExtensionIconID = 129,
- kExtensionNotLoadedIconID = 130,
-
- kCardStringList = 128,
- kCardName = 1,
- kCardType = 2,
- kCardHelpString = 3,
- kCardVendorName = 4,
- kCardClientName = 5
- };
-
-
- // per-socket globals which you must define in "CardSpecific.h"
-
- typedef struct PCCardPerSocketState PCCardPerSocketState;
-
- enum
- {
- kCardIsConfigured = (1 << 0)
- };
-
-
- #include "CardSpecific.h"
-
-
- typedef struct PCCardClientGlobalsRec
- {
- UInt32 clientHandle;
- Str255 cardName;
- Str255 cardType;
- Str255 vendorName;
- Str255 clientName;
- Str255 helpString;
- Handle cardIconSuite;
- UInt32 numberOfSockets;
- PCCardPerSocketState socketState[1];
- } PCCardClientGlobalsRec;
-
-
- // PC Card Client “framework” functions
-
- void main(void);
-
- Boolean PCCardManagerIsAvailable(UInt32 * numberOfSockets);
-
- OSErr InstallPCCardClient(UInt32 numberOfSockets);
-
- pascal OSErr HandlePCCardEvent(ClientCallbackPBPtr pb);
-
- OSErr HandleCardRemoval(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState, ClientCallbackPBPtr pb);
- OSErr HandleCardEjectRequest(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState, ClientCallbackPBPtr pb);
- OSErr HandleCardReady(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState, ClientCallbackPBPtr pb);
- OSErr HandleGetClientInfo(PCCardClientGlobalsRec * globals, GetClientInfoPB *pb);
- OSErr HandleCardSuspend(PCCardClientGlobalsRec * globals, ClientCallbackPBPtr pb);
- OSErr HandleCardResume(PCCardClientGlobalsRec * globals, ClientCallbackPBPtr pb);
-
-
- // Card-specific functions you need to supply for your card
-
- extern Boolean IsThisMyCard(PCCardClientGlobalsRec * globals,UInt16 socket);
- extern OSErr ConfigureMyCard(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState,UInt16 socket);
- extern OSErr UnconfigureMyCard(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState,UInt16 socket);
- extern void MyCardInterruptHandler(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState,UInt16 socket);
-
-
- #endif
-